<include file="public:header" />
	<div class="toptip link_g">
		<h2>提示：</h2>
		<p><font color="red">升级会导致项目二次开发的程序被覆盖，请谨慎操作！</font></p>
	</div>
	<div id="auth_list">
		<table width="100%"  border="0" cellpadding="0" cellspacing="0"  class="link_lan" style="margin-bottom:15px;" >
			<tr>
				<td class="admin_list_tit admin_list_first">目录权限检测</td>
				<td width="150" align="center" class="admin_list_tit">读取权限</td>
				<td width="150" align="center" class="admin_list_tit">写入权限</td>
			</tr>
			<volist name="checked_dirs" id="vo">
			<tr>
				<td class="admin_list admin_list_first">{$vo.dir}</td>
				<td width="150" align="center" class="admin_list">{$vo.read}</td>
				<td width="150" align="center" class="admin_list">{$vo.write}</td>
			</tr>
			</volist>
		</table>
	</div>
	<form id="J_install_form" action="{:U('apply/updater_auth')}" method="post" style="display:none">
		<div class="toptit">升级进程</div>
		<div id="J_process" style="padding:20px; padding-top:10px; height:160px;overflow:auto;margin-bottom: 10px;"></div>
		<input name="time" value="{$time}" type="hidden">
		<iframe src="about:blank" style="width:500px; height:300px;display:none;" name="post_target"></iframe>
	</form>
	<if condition="$auth eq 1">
		<div class="toptit"><font color="red">升级文件或路径必须具备‘读写权限’，请手动将列表内文件或路径设置‘读写权限’</font></div>
	</if>
	<table width="100%" border="0" cellspacing="10"  class="admin_list_btm">
		<tr id="J_run">
			<td>
				<input name="ButADD" type="button" class="admin_submit" id="UpdaterBtn" value="继续升级" onclick="updater();" <if condition="$auth eq 1">style="display:none"</if>/>
				<input type="button" class="admin_submit" id="CheckedBtn" value="重新检测" onclick="install_updater_auth();" <if condition="$auth eq 0">style="display:none"</if>/>
				<input name="ButADD" type="button" class="admin_submit" id="ButADD" value="返回"  onclick="window.location='{:U('apply/index')}'"/>
			</td>
		</tr>
		<tr id="J_end" style="display:none">
			<td>
				<input name="ButADD" type="button" class="admin_submit" id="ButADD" value="升级完成"  onclick="window.location='{:U('apply/index')}'"/>
			</td>
		</tr>
	</table>
</div>
<include file="public:footer" />
<script>
	function updater(){
		$('#J_process').empty();
		$('#J_install_form').show().attr('target','post_target');
	    $('#J_install_form').submit();
	    $('#auth_list,#J_run').hide();
	}
	function show_process(html){
	    $('#J_process').html($('#J_process').html() + html);
	    var _t = $('#J_process').get(0);
	    _t.scrollTop = _t.scrollHeight;
	}
	function install_failure(a){
		if(a == 1){
			$('#UpdaterBtn,#CheckedBtn').hide();
		}else if(a == 2){
			$('#UpdaterBtn').hide();
			$('#CheckedBtn').show();
		}
	    $('#J_run').show();
	}
	function install_successed(){
	    $('#J_end').show();
	}
	function install_updater_auth(){
		window.location.href="{:U('apply/updater_auth',array('time'=>$time))}";
	}
</script>
</body>
</html>